//导入ajax
//统一管理强求的
import ajax from "./ajax";
import mockAjax from "./mockAjax";
export const ReqCategoryListData=()=> ajax.get('/product/getBaseCategoryList')
//获取轮播图的数据
export const reqGetBannerListData=()=>mockAjax.get("/bannerList")
//获取楼层的数据
export const reqGetFloorsistData=()=>mockAjax.get("/floorsList")
//获取搜索的额数据
export const reqGetSearchGoodsInfoData=(searchParams)=>ajax.post("/list",searchParams)
//获取详情的数据
export const reqGetGoodDetailInfoData=(id)=>ajax.get("/item/"+id)
//添加成功购物车界面
export const  reqAddOrUpdateSkuInfoToShopCart=(skuId,skuNum)=>ajax.post(`/cart/addToCart/${skuId }/${ skuNum }`)
//购物车请求数据
export const  reqShopCartListData=()=>ajax.get('/cart/cartList')
//请求单选的数据
export const  reqChangeShopCartInfoState=(skuID,isChecked)=>ajax.get(`/cart/checkCart/${skuID}/${isChecked}`)
//批量选中
export const reqChangeAllCartState=(isChecked,skuIDList)=>ajax.post(`/cart/batchCheckCart/${isChecked}`,skuIDList)
//删除单个数据
export const reqDeleteOneCartInfo= (skuId) => ajax.delete(`/cart/deleteCart/${skuId}`)
11. //批量删除多条商品数据  '/cart/batchDeleteCart'
// export const reqDeleteSelectedCartInfo = (skuIdList) => ajax.delete(`/cart/batchDeleteCart`, { data: skuIdList })
// 批量删除多条商品数据的接口改成了post请求了,不再是Delete请求
export const reqDeleteSelectedCartInfo = (skuIdList)=>ajax.post(`/cart/batchDeleteCart`,skuIdList)
//获取验证码的数据
export const  reqGetVerifyCode= phone=>ajax.get(`/user/passport/sendCode/${phone}`)
//注册功能的方法
export const reqRegisterUser= (user) => ajax.post(`/user/passport/register`, user)
//登录的功能的实现
export const reqUserLogin=(user)=>ajax.post('/user/passport/login',user)
//实现的登出
export const reqUserLoginOut=()=>ajax.get('user/passport/logout')
//收件人地址的接口
export const reqGetUserAddressListData=()=>ajax.get('/user/userAddress/auth/findUserAddressList')


//结算中心详细数据的接口
export const reqGetTradeInfoData=()=>ajax.get('/order/auth/trade')
//提交订单的接口函数
export const reqSubmitOrder = (tradeNo, params) => ajax.post(`/order/auth/submitOrder?tradeNo=${tradeNo}`, params)

// 19. 获取支付链接 
export const reqGetPayQRcode = (orderId) => ajax.get(`/payment/weixin/createNative/${orderId}`)

// 20. 查询订单支付状态
export const reqQueryPayStatus = (orderId) => ajax.get(`/payment/weixin/queryPayStatus/${orderId}`)

// 21. 查询订单中心列表 
export const reqGetCenterListData = (page,limit)=> ajax.get(`/order/auth/${page}/${limit}`)
